PreviewView
An Android android.view.View displaying the Camera feed of a CameraPreviewOutput.
It can be used directly in an Android View hierarchy, or through the CameraPreview composable of the compose module.
val previewView = PreviewView(context)
previewView.previewOutput = previewOutputView coordinates (createMeteringPoint, convertCameraPointToViewPoint, convertViewPointToCameraPoint) are in pixels, relative to this view, like the coordinates of a MotionEvent.
Properties
The GestureControllers installed on this view, e.g. a ZoomGestureController for a native pinch-to-zoom gesture, or a TapToFocusGestureController.
Whether the preview uses a SurfaceView (PreviewImplementationMode.PERFORMANCE) or a TextureView (PreviewImplementationMode.COMPATIBLE).
Called when the preview started streaming.
Called when the preview stopped streaming.
The CameraPreviewOutput to display.
How the Camera feed is scaled into this view's bounds.
Functions
Converts the given cameraPoint in Camera sensor coordinates into a Point in view coordinates (pixels), relative to this view.
Converts the coordinates of a ScannedObject into view coordinates. Not supported on Android, like V5: ScannedObjects are only produced on iOS.
Creates a MeteringPoint to focus AE/AF/AWB on the Camera via CameraController.focusTo.
Takes a snapshot of this view's current contents, and returns it as an Image (e.g. for a fast capture when a full photo is not needed). It runs on the main thread.